package com.hujf.flink.序列化.schema;

import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericRecord;

/**
 * @Author hujf
 * @Date 2022/4/18 10:56
 * @Description TODO
 */
public class AvroTest {
    public static void main(String[] args) {
        Schema schema = new Schema.Parser().parse("{\"namespace\":\"\",\"type\":\"record\",\"name\":\"MyPojo\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"}]}");
        GenericRecord bob = new GenericData.Record(schema) ;
        bob.put("id",1);
        System.out.println(bob.get("id"));
    }
}
